package com.sleep.drug_traceability.controller;

import com.sleep.drug_traceability.service.PerfectService;
import com.sleep.drug_traceability.vo.Result;
import com.sleep.drug_traceability.vo.params.ManParam;
import com.sleep.drug_traceability.vo.params.SelParam;
import com.sleep.drug_traceability.vo.params.SupParam;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @author Sleep-6000
 * @date 2022/4/25
 */
@RestController
@RequestMapping("perfect")
public class PerfectController {

    @Autowired
    private PerfectService perfectService;

    /**
     * 完善药品生产商信息
     * @param manParam manParam
     * @param token token
     * @return Result
     */
    @PostMapping("man")
    public Result perfectManInfo(@RequestBody ManParam manParam,
                                 @RequestHeader("Authorization") String token) {
        return perfectService.perfectManInfo(manParam, token);
    }

    /**
     * 完善销售商信息
     * @param selParam selParam
     * @param token token
     * @return Result
     */
    @PostMapping("sel")
    public Result perfectSelInfo(@RequestBody SelParam selParam,
                                 @RequestHeader("Authorization") String token) {
        return perfectService.perfectSelInfo(selParam, token);
    }

    /**
     * 完善监管部门信息
     * @param supParam supParam
     * @param token token
     * @return Result
     */
    @PostMapping("sup")
    public Result perfectSupInfo(@RequestBody SupParam supParam,
                                 @RequestHeader("Authorization") String token) {
        return perfectService.perfectSupInfo(supParam, token);
    }
}
